package com.itheima.reggie.controller;


import com.itheima.reggie.bean.ShoppingCart;
import com.itheima.reggie.common.R;
import com.itheima.reggie.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/shoppingCart")
@RestController
public class ShoppingCartController {
    @Autowired
    private ShoppingCartService ss;

    @GetMapping("/list")
    public R list(){
        try {
            List<ShoppingCart> list = ss.findList();
            return R.success(list);
        } catch (Exception e) {
            e.printStackTrace();
            return R.error("查询失败！");
        }


    }



}
